<?php

	include ('../Config/conn.php'); 
	include ('../Model/item.class.php'); 
	
	$itens = array();
	$contador = 0;
					
	$result = $db->query("SELECT * FROM item ",
							   PDO::FETCH_ASSOC);
	
	
	if ($result->rowCount() > 0) {
		
		while($item = $result->fetch()){
			
			$ObjItem = new Item($db, $item['cd_item'], $item['cd_categoria'], $item['nm_item'], $item['nr_classificacao']);
			$itens[$contador] = $ObjItem;
			
			$contador = $contador + 1;
		}
		
		$result->closeCursor();	
	} 
	
	include ('../Config/destruct.php'); 

?>